package com.ruoyi.buss.report.controller;

import com.ruoyi.buss.report.domain.ReportWgzyscGrLsb;
import com.ruoyi.buss.report.domain.ReportWgzyscShLsb;
import com.ruoyi.buss.report.service.IReportWgZyscLsbService;
import com.ruoyi.buss.utils.ListUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.security.annotation.PreAuthorize;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 网格社区报表Controller
 * 
 * @author sxy
 * @date 2021-07-16
 */
@RestController
@RequestMapping("/reportLsb")
public class ReportWgZyscLsbController extends BaseController
{
    @Autowired
    private IReportWgZyscLsbService reportWgZyscLsbService;

    @Autowired
    private TokenService tokenService;

    /**
     * 4.2.2-2  网格社区业务进度表包片居民
     */
    @PreAuthorize(hasPermi = "buss:wgsqlsb:wgzyscywjdb")
    @GetMapping("/wgzyscywjdb")
    public TableDataInfo wgzyscywjdb(ReportWgzyscShLsb reportWgsqLsb)
    {
        reportWgsqLsb.setSjrq(ListUtil.getSjrq(reportWgsqLsb.getSjrq()));
        LoginUser userInfo = tokenService.getLoginUser();
        startPage();
        List<ReportWgzyscShLsb> list = reportWgZyscLsbService.wgzyscywjdb(reportWgsqLsb,userInfo);
        return getDataTable(list);
    }

    /**
     * 4.2.2-2  网格社区业务进度表包片居民
     */
    @PreAuthorize(hasPermi = "buss:wgsqywjdbhz:wgzyscgrywjdb")
    @GetMapping("/wgzyscgrywjdb")
    public TableDataInfo wgzyscgrywjdb(ReportWgzyscGrLsb reportWgsqLsb)
    {
        reportWgsqLsb.setSjrq(ListUtil.getSjrq(reportWgsqLsb.getSjrq()));
        LoginUser userInfo = tokenService.getLoginUser();
        startPage();
        List<ReportWgzyscGrLsb> list = reportWgZyscLsbService.wgzyscgrywjdb(reportWgsqLsb,userInfo);
        return getDataTable(list);
    }

//
//    /**
//     * 导出网格社区报表列表
//     */
//    @PreAuthorize(hasPermi = "buss:wgsqlsb:export")
//    @Log(title = "网格社区报表", businessType = BusinessType.EXPORT)
//    @PostMapping("/exportWgsqywjdbService")
//    public void export(HttpServletResponse response, ReportWgsqLsb reportWgsqLsb) throws IOException
//    {
//        reportWgsqLsb.setSjrq(ListUtil.getSjrq(reportWgsqLsb.getSjrq()));
//        LoginUser userInfo = tokenService.getLoginUser();
//
//        List<ReportWgsqLsb> list = reportWgZyscLsbService.selectReportWgZyscLsbList(reportWgsqLsb,userInfo,0);
//        ExcelUtil<ReportWgsqLsb> util = new ExcelUtil<ReportWgsqLsb>(ReportWgsqLsb.class);
//        util.exportExcel(response, list, "网格社区报表数据");
//    }


}
